﻿<!--#include file="conn.asp"-->
<!--#include file="inc/CHAR.INC"-->
<%if request("act")="edit" then
ninfo="修改" 
else
ninfo="添加" 
end if
%>
<%set rs=server.createobject("adodb.recordset")
%>
<%if request("act")="save" then
id=request.form("id")
mhmc=request.form("mhmc")
zzmc=request.form("zzmc")
zm=request.form("zm")
zt=request.form("zt")
mhfm=request.form("mhfm")
mhjs=request.form("mhjs")
dqid=request.form("dqid")
classid=request.form("classid")
tj=request.form("tj")
mhbm=request.form("mhbm")
mhtc=request.form("mhtc")
Sql="Select * From zz where zzmc='"&trim(zzmc)&"'"
Rs.Open Sql,Conn,1,3
if rs.eof then
Rs.AddNew
rs("zzmc")=trim(zzmc)
rs("zm")=left(Hanzi2Pinyin(trim(zzmc)),1)
rs.update
rs.close
Sql="Select * From zz where zzmc='"&trim(zzmc)&"'"
Rs.Open Sql,Conn,1,3
zzid=rs("id")
rs.close
else
zzid=rs("id")
rs.close
end if


if id="" then
sql="select * from comics"
rs.open sql,conn,1,3
rs.addnew
rs("adddate")=now()
else
sql="select * from comics where id="&id
rs.open sql,conn,1,3
end if
rs("classid")=classid
rs("mhmc")=mhmc
rs("zzid")=zzid
rs("zm")=zm
rs("zt")=zt
rs("mhfm")=mhfm
rs("mhbm")=mhbm
rs("mhtc")=mhtc
rs("dqid")=dqid
rs("mhjs")=htmlencode2(trim(mhjs))
rs("hits_d_d")=now()
rs("hits_m_d")=now()
rs("hits_w_d")=DatePart("ww", now())
rs("tj")=tj
rs.update
rs.close
set rs=nothing 
response.write("<script>alert('成功："&ninfo&"漫画资料成功!现在返回管理');location='comics_manage.asp'</script>")
response.end
end if%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="images/style.css" type="text/css" rel="stylesheet">
    <meta content="MSHTML 6.00.3790.0" name="GENERATOR">
</head>
<body>
    <%
if request("act")="edit" then
id=request("id")
set rs=server.createobject("adodb.recordset")
sql="select * from comics where id="&id
rs.open sql,conn,1,1
mhmc=rs("mhmc")
zzid=rs("zzid")
classid=rs("classid")
dqid=rs("dqid")
zt=rs("zt")
zm=rs("zm")
mhfm=rs("mhfm")
mhjs=rs("mhjs")
tj=rs("tj")
mhbm=rs("mhbm")
mhtc=rs("mhtc")
end if
    %>
    <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
        <form name="form1" method="post" action="?comicid=<%=request("comicid")%>&cjcomicid=<%=request("cjcomicid")%>&act=save">
        <tr bgcolor="3972B4">
            <td colspan="3" bgcolor="e7e7e7">
                <div align="center">
                    <strong><font color="#000000">
                        <%=ninfo%>漫画数据</font></strong></div>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="17%">
                <div align="right">
                    漫画名称</div>
            </td>
            <td width="43%" bgcolor="#FFFFFF">
                <input name="mhmc" type="text" id="mhmc" value="<%=mhmc%>" size="40"><input name="id"
                    type="hidden" id="id" value="<%=id%>" size="40">
            </td>
            <td width="40%" rowspan="8" bgcolor="#FFFFFF">
                <div align="center">
                    <%if mhfm<>"" then%>
                    <img src="../cpic/<%=mhfm%>">
                    <%end if%>
                </div>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="17%">
                <div align="right">
                    漫画作者
                </div>
            </td>
            <td width="43%" bgcolor="#FFFFFF">
                <%
	  if zzid<>"" then
	  set rs2=server.createobject("adodb.recordset")
sql2="select * from zz where id='"&zzid&"'"
rs2.open sql2,conn,1,1
if rs2.eof then
zzmc=""
else
zzmc=rs2("zzmc")
                %>
                <%end if
rs2.close
end if
                %>
                <input name="zzmc" type="text" id="zzmc" value="<%=zzmc%>" size="20">
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="17%">
                <div align="right">
                    分类
                </div>
            </td>
            <td width="43%" bgcolor="#FFFFFF">
                <select name="classid" size="1" id="select" class="classid">
                    <%  set rs2=server.CreateObject("ADODB.RecordSet")
sql2="select * from class"
rs2.Open sql2,conn,1,1
if rs2.EOF then
response.write("<option value=""0"">没有分类</option>")
else
while not rs2.EOF
response.write("<option value="&rs2("id")&"")
if classid=rs2("id") then
response.write(" selected")
end if
response.write(">"&rs2("classname")&"</option>")                    
rs2.MoveNext
wend
rs2.close
end if %>
                </select>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="17%">
                <div align="right">
                    地区
                </div>
            </td>
            <td width="43%" bgcolor="#FFFFFF">
                <select name="dqid" size="1" id="select" class="dqid">
                    <%  set rs2=server.CreateObject("ADODB.RecordSet")
sql2="select * from diqu"
rs2.Open sql2,conn,1,1
if rs2.EOF then
response.write("<option value=""0"">没有分类</option>")
else
while not rs2.EOF
response.write("<option value="&rs2("id")&"")
if dqid=rs2("id") then
response.write(" selected")
end if
response.write(">"&rs2("diqu")&"</option>")                    
rs2.MoveNext
wend
rs2.close
end if %>
                </select>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="17%" bgcolor="#FFFFFF">
                <div align="right">
                    完结状态</div>
            </td>
            <td bgcolor="#FFFFFF">
                <input name="zt" type="radio" value="0" <%if zt=false then%>checked<%end if%>>
                连载中
                <input name="zt" type="radio" value="1" <%if zt=true then%>checked<%end if%>>
                已完结
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="17%" bgcolor="#FFFFFF">
                <div align="right">
                    封面图片</div>
            </td>
            <td bgcolor="#FFFFFF">
                <input name="mhfm" type="text" id="mhfm" value="<%=mhfm%>" size="40">
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="17%" bgcolor="#FFFFFF">
                <div align="right">
                     字母</div>
            </td>
            <td bgcolor="#FFFFFF">
                <input name="zm" type="text" id="zm" value="<%=zm%>" size="40">
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="17%" bgcolor="#FFFFFF">
                <div align="right">
                    漫画别名</div>
            </td>
            <td bgcolor="#FFFFFF">
                <input name="mhbm" type="text" id="mhbm" value="<%=mhbm%>" size="40">
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="17%" bgcolor="#FFFFFF">
                <div align="right">
                    漫画题材</div>
            </td>
            <td bgcolor="#FFFFFF">
                <input name="mhtc" type="text" id="mhtc" value="<%=mhtc%>" size="40">
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="17%" bgcolor="#FFFFFF">
                <div align="right">
                    介绍</div>
            </td>
            <td bgcolor="#FFFFFF">
                <textarea name="mhjs" cols="40" rows="10" id="mhjs"><%=htmlencode1(mhjs)%></textarea>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="17%" bgcolor="#FFFFFF">
                <div align="right">
                    是否推荐</div>
            </td>
            <td bgcolor="#FFFFFF">
                <input name="tj" type="radio" value="0" <%if tj=false then%>checked<%end if%>>
                否
                <input name="tj" type="radio" value="1" <%if tj=true then%>checked<%end if%>>
                是
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td colspan="3">
                <div align="center">
                    <input type="submit" name="Submit" class="Submit" value="确认<%=ninfo%>">
                </div>
            </td>
        </tr>
        </form>
    </table>
</body>
</html>
<script language="JavaScript" type="text/JavaScript">
    function SwitchNewsType(NewsType) {
        switch (NewsType) {
            case "PicNews":
                document.getElementById('PicNews').style.display = '';
                break;

        }
    }

</script>
